package demo;

import java.security.PublicKey;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 19182
 * Date: 2025-07-01
 * Time: 18:06
 */
public class Person implements Cloneable{
    public int age;
    public double score;
    public String name;
    public Money m;

    public Person(int age, double score, String name, int m) {
        this.age = age;
        this.score = score;
        this.name = name;
        this.m = new Money(m);
    }


    @Override
    public String toString() {
        return "Person{" +
                "age=" + age +
                ", score=" + score +
                ", name='" + name + '\'' +
                ", m=" + m +
                '}';
    }

    @Override
    protected Object clone() throws CloneNotSupportedException {
        Person tmp = (Person)super.clone();
        tmp.m = (Money)this.m.clone();
        return tmp;
    }
}
